package eu.jpereira.trainings.designpatterns.structural.decorator.channel.decorator;

public class WordCensor extends SocialChannelDecorator {

	private String censoredWord;
	
	public WordCensor(String censoredWord)
	{
		this.censoredWord = censoredWord;
	}
	
	@Override
	public void deliverMessage(String message) {
		String m = message.replace(censoredWord, "###");
		delegate.deliverMessage(m);
	}

}
